#include <iostream>
using namespace std;

class Point
{
public:
    int x;
    int y;
    Point(int x, int y) : x{x}, y{y} {}
};
// 写一个全局函数，让 << 能处理你自定义的类型
ostream &operator<<(ostream &os, const Point &p)
{
    os << "(" << p.x << ", " << p.y << ")";
    return os;
}
// 输入运算符
istream &operator>>(istream &is, Point &p)
{
    is >> p.x >> p.y;
    return is;
}
int main()
{
    Point p1{1, 2};
    cout << p1 << endl;
    cin >> p1;
    cout << p1 << endl;
}
